function AJAX()
{
    this.METHOD="";
    this.URL="";
    this.ASYNC=false;
    this.RETURN_TYPE="TEXT";
    this.POST_PARAMS="";
    this.ON_ERROR_CALLBACK_FN="";
    
    AJAX.prototype.GetAjaxHandle=getAjaxHandle;
    AJAX.prototype.Send=Send;
    
}
function Send()
{
    
    var xmlHTTP=null
    xmlHTTP=this.GetAjaxHandle();
    
    xmlHTTP.open(this.METHOD,this.URL,false)
    if(this.METHOD=="POST")
    {
        xmlHTTP.send(this.POST_PARAMS)
    }
    else
    {
        xmlHTTP.send(null)
    }
    while(xmlHTTP.readyState!=4)
    {
    }
    
//    if(xmlHTTP.status!=200)
//    {
//        if(typeof this.ON_ERROR_CALLBACK_FN!="undefined" && this.ON_ERROR_CALLBACK_FN!="")
//            eval(this.ON_ERROR_CALLBACK_FN);
//        else
//            alert("Error occured, callback function not located.")
//        
//    }
    if(this.RETURN_TYPE=="XML")
    {
        return xmlHTTP.responseXML
    }
    else 
    {
        return xmlHTTP.responseText
    }
    xmlHTTP=null
}

function Error(obj)
{
    this.ERROR_MESSAGE=obj.status;
}
function getAjaxHandle()
{
    
  var xmlHttp1;
  try
    {
    // Firefox, Opera 8.0+, Safari, IE 7
    xmlHttp1 = new XMLHttpRequest()
    
    }
  catch (e)
    {
    // Internet Explorer 6
    try
      {
      xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      try
        { // Internet Explorer 5.5
        xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    return xmlHttp1;
 }


